package com.kaifamiao.www.demo.do0812;

import java.util.Vector;

public class VecotrDemo {
    public static void main(String[] args) {

//        Vector vector = new Vector();
        Vector vector = new Vector(3,3);
        vector.add(1);
        vector.add(2);
        vector.add(3);
        vector.add(4);
        vector.add(5);
        //容量  可以存放多少个元素
        System.out.println("容量"+vector.capacity());
        //大小  已经放了多少个元素
        System.out.println("大小"+vector.size());
        System.out.println(vector);
        //设置大小
//        vector.setSize(1);
        vector.set(2,"q");
//        System.out.println(vector.capacity());
//        System.out.println(vector.size());
        System.out.println(vector);
        vector.remove(0);
        System.out.println(vector);
        vector.get(2);
        System.out.println(vector.get(2));

    }
}
